﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;


namespace anpr.Models
{
    public class SampleData : DropCreateDatabaseIfModelChanges<ANPREntities>
    {
        protected override void Seed(ANPREntities context)
        {
            new List<Officer>
            {
                new Officer { officerID=1, firstName="John", midName="J.", lastName="Doe", DOB=DateTime.Parse("12/12/1990 12:00"), street="1 Sydney Rd", suburb="Sydney", state="NSW", postcode="2000", phoneNumber="0255554444", mobileNumber="0411222254", posting="Lidcombe", createDate=DateTime.Now },
                new Officer { officerID=2, firstName="Peter", midName="J.", lastName="Who", DOB=DateTime.Parse("12/12/1990 12:00"), street="1 Sydney Rd", suburb="Sydney", state="NSW", postcode="2000", phoneNumber="0255554444", mobileNumber="0411222254", posting="Lidcombe", createDate=DateTime.Now }
            }.ForEach(o => context.officers.Add(o));
            context.SaveChanges();
        }
    }
}